package com.mcxx.modules.temporary.cancel.service.read;

import com.mcxx.modules.base.utils.QueryParamUtil;
import com.mcxx.modules.temporary.cancel.dao.read.TmpCancelReadDao;
import com.mcxx.modules.temporary.cancel.dto.TmpCancelDTO;
import com.mcxx.modules.temporary.cancel.dto.TmpCancelExcelDTO;
import com.mcxx.modules.temporary.cancel.entity.TmpCancelEntity;
import com.mcxx.modules.temporary.cancel.param.TmpCancelParam;
import com.yinhai.ta404.core.restservice.requestbean.PageParam;
import com.yinhai.ta404.core.restservice.resultbean.Page;
import com.yinhai.ta404.core.security.vo.UserAccountVo;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@TaTransactional(readOnly = true)
public class TmpCancelReadService {

    @Autowired
    private TmpCancelReadDao tmpCancelReadDao;


    public Page listSalvationCancel(TmpCancelParam param, PageParam pageParam, UserAccountVo accountVo) {

        QueryParamUtil.setBaseParamValue(param,accountVo);

        tmpCancelReadDao.beginPager(pageParam);
        List<TmpCancelDTO> list = tmpCancelReadDao.listByParam(param);

        return tmpCancelReadDao.endPager(list);
    }


    public List<TmpCancelDTO> selectSalvationCancelList(TmpCancelParam param) {
        return tmpCancelReadDao.listByParam(param);
    }


   public  List<TmpCancelExcelDTO> exportSalvationList(TmpCancelParam param){
       return tmpCancelReadDao.exportSalvationList(param);
   }

}
